A conventional Ethernet switch is generally composed of a specialized Application Specific Integrated Circuits (ASIC) chip and a central processing unit (CPU) control system which are called a forwarding plane and a control plane respectively.
In the forwarding plane, the ASIC chip can learn by itself a source MAC address of an Ethernet packet and associate the source MAC address with a packet receiving port. This association relationship can generate a MAC address table. When the above MAC address is used as a destination MAC address of the data packet, the ASIC chip can forward the data packet to the associated port according to the previously learned MAC address table entries, thereby achieving accurate forwarding.
In the control plane, the CPU needs to run a large number of Layer 2 and Layer 3 protocols to control forwarding paths of the forwarding plane and to meet specific service requirements. In the process of running the protocols, based on the consideration of security, efficiency, and so on, it needs to search for the associated port of the specified MAC address frequently; when searching for the associated port of the specified MAC address, the learned MAC address table in the ASIC chip can be queried through a specific hardware interface, however, this approach not only has low-searching efficiency, but also preempts physical interface resources with a configuration channel. Therefore, establishing a MAC address software table in a memory is a common solution.
At present, there are two following methods to create the MAC address software table in the memory:
In a first method, after the forwarding plane learns MAC address table entries, it sends the MAC address table entries through a hardware interface to the control plane in a form of a message for the control plane processing. After receiving the message, the control plane creates a MAC address software table entries in the memory.
In a second method, the control plane creates an independent task in an operating system, periodically queries the MAC address table entries in the forwarding plane, and updates the MAC address software table entries in the memory when changes are found.
In the above two methods, the method based on the message has slightly better timeliness. However, when there are a large number of MAC address table entries that need to be notified to the control plane in a short time, there is a risk of losing messages, which will result in that the MAC address software table is not synchronized with the MAC address table in the forwarding plane, thus leading to a series of problems. The method of periodical query has slightly better security, but its timeliness is poor, and this method occupies certain processor resources of the control plane for a long time, thus this method can only be used as a supplement to the method based on the message.